using UnityEngine;
using System.Collections;
public class CustomEnumerator : IEnumerator
{
    private int[] numbers = { 1, 2, 3, 4, 5 };
    private int index = -1;
    public object Current
    {
        get
        {
            if (index < 0 || index >= numbers.Length)
                throw new System.InvalidOperationException();
            return numbers[index];
        }
    }
    public bool MoveNext()
    {
        index++;
        return index < numbers.Length;
    }
    public void Reset()
    {
        index = -1;
    }
}